package com.aiyige.location.model;


import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by zhuyakun on 2017/10/27.
 */

public class LocationData implements Parcelable {
    double latitude = 0;
    double longitude = 0;
    float accuracy = 0;
    double altitude = 0;
    float speed = 0;
    float bearing = 0;
    String buildingId = "";
    String floor = "";
    String address = "";
    String country = "";
    String province = "";
    String city = "";
    String district = "";
    String street = "";
    String streetNum = "";
    String cityCode = "";
    String adCode = "";
    String poiName = "";
    String aoiName = "";
    int gpsAccuracyStatus;
    int locationType;
    String locationDetail = "";
    String errorInfo = "";
    int errorCode;
    boolean success = false;


    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public float getAccuracy() {
        return accuracy;
    }

    public void setAccuracy(float accuracy) {
        this.accuracy = accuracy;
    }

    public double getAltitude() {
        return altitude;
    }

    public void setAltitude(double altitude) {
        this.altitude = altitude;
    }

    public float getSpeed() {
        return speed;
    }

    public void setSpeed(float speed) {
        this.speed = speed;
    }

    public float getBearing() {
        return bearing;
    }

    public void setBearing(float bearing) {
        this.bearing = bearing;
    }

    public String getBuildingId() {
        return buildingId;
    }

    public void setBuildingId(String buildingId) {
        this.buildingId = buildingId;
    }

    public String getFloor() {
        return floor;
    }

    public void setFloor(String floor) {
        this.floor = floor;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getStreetNum() {
        return streetNum;
    }

    public void setStreetNum(String streetNum) {
        this.streetNum = streetNum;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getAdCode() {
        return adCode;
    }

    public void setAdCode(String adCode) {
        this.adCode = adCode;
    }

    public String getPoiName() {
        return poiName;
    }

    public void setPoiName(String poiName) {
        this.poiName = poiName;
    }

    public String getAoiName() {
        return aoiName;
    }

    public void setAoiName(String aoiName) {
        this.aoiName = aoiName;
    }

    public int getGpsAccuracyStatus() {
        return gpsAccuracyStatus;
    }

    public void setGpsAccuracyStatus(int gpsAccuracyStatus) {
        this.gpsAccuracyStatus = gpsAccuracyStatus;
    }

    public int getLocationType() {
        return locationType;
    }

    public void setLocationType(int locationType) {
        this.locationType = locationType;
    }

    public String getLocationDetail() {
        return locationDetail;
    }

    public void setLocationDetail(String locationDetail) {
        this.locationDetail = locationDetail;
    }

    public String getErrorInfo() {
        return errorInfo;
    }

    public void setErrorInfo(String errorInfo) {
        this.errorInfo = errorInfo;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeDouble(this.latitude);
        dest.writeDouble(this.longitude);
        dest.writeFloat(this.accuracy);
        dest.writeDouble(this.altitude);
        dest.writeFloat(this.speed);
        dest.writeFloat(this.bearing);
        dest.writeString(this.buildingId);
        dest.writeString(this.floor);
        dest.writeString(this.address);
        dest.writeString(this.country);
        dest.writeString(this.province);
        dest.writeString(this.city);
        dest.writeString(this.district);
        dest.writeString(this.street);
        dest.writeString(this.streetNum);
        dest.writeString(this.cityCode);
        dest.writeString(this.adCode);
        dest.writeString(this.poiName);
        dest.writeString(this.aoiName);
        dest.writeInt(this.gpsAccuracyStatus);
        dest.writeInt(this.locationType);
        dest.writeString(this.locationDetail);
        dest.writeString(this.errorInfo);
        dest.writeInt(this.errorCode);
        dest.writeByte(this.success ? (byte) 1 : (byte) 0);
    }

    public LocationData() {
    }

    protected LocationData(Parcel in) {
        this.latitude = in.readDouble();
        this.longitude = in.readDouble();
        this.accuracy = in.readFloat();
        this.altitude = in.readDouble();
        this.speed = in.readFloat();
        this.bearing = in.readFloat();
        this.buildingId = in.readString();
        this.floor = in.readString();
        this.address = in.readString();
        this.country = in.readString();
        this.province = in.readString();
        this.city = in.readString();
        this.district = in.readString();
        this.street = in.readString();
        this.streetNum = in.readString();
        this.cityCode = in.readString();
        this.adCode = in.readString();
        this.poiName = in.readString();
        this.aoiName = in.readString();
        this.gpsAccuracyStatus = in.readInt();
        this.locationType = in.readInt();
        this.locationDetail = in.readString();
        this.errorInfo = in.readString();
        this.errorCode = in.readInt();
        this.success = in.readByte() != 0;
    }

    public static final Parcelable.Creator<LocationData> CREATOR = new Parcelable.Creator<LocationData>() {
        @Override
        public LocationData createFromParcel(Parcel source) {
            return new LocationData(source);
        }

        @Override
        public LocationData[] newArray(int size) {
            return new LocationData[size];
        }
    };
}
